<template>
    <div id="talking">
        <van-sticky>
            <van-nav-bar title="xx" left-text="返回" left-arrow @click-left="onClickLeft" />
        </van-sticky>
        <div id="talk_con">
            <Socket :username="user"></Socket>
        </div>
    </div>
</template>

<script setup lang="ts">
import Socket from './component/Socket.vue'
import { ref } from 'vue'
import { useRoute } from 'vue-router'
const user = ref('')
const route = useRoute()
import { onMounted } from 'vue'
onMounted(() => {
    user.value = route.query.username
    // console.log(JSON.parse(sessionStorage.getItem('user')['username'])||'')
    // console.log(JSON.parse(sessionStorage.getItem('user'))['username']);
    // user.value = JSON.parse(localStorage.getItem('user'))['username']
})
const onClickLeft = () => {
    window.location.href = '/me'
}
</script>

<style scoped>
#talking {
    width: 100vw;
    height: 100vh;
    background: white;

    #talk_con {
        width: 100vw;
        min-height: 90vh;
        background-color: #f2f2f2;
        padding-top: 20px;
    }
}
</style>